<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>后台管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="__LAYUIADMIN__/res/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="__LAYUIADMIN__/res/adminui/dist/css/admin.css" media="all">
  <style>
    .comment-list .lis-item {
      white-space: nowrap;
      overflow: hidden;
    }

    .comment-list .lis-item .comment-s {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .comment-list .lis-item .comment-s .del-btn {
      color: #ff5722;
    }

    .comment-list .lis-item .article {
      display: inline-block;
      max-width: 200px;
      overflow: hidden;
      color: #5f5f5f;
    }

    .comment-list .nickname {
      color: #16baaa;
    }


    .comment-list .tim {
      color: #6b7280;
      font-size: 12px;
    }
  </style>
</head>

<body>

  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">

      <div class="layui-col-sm6 layui-col-md3">
        <div class="layui-card">
          <div class="layui-card-header">
            文章
            <span class="layui-badge layui-bg-red layuiadmin-badge">待审核：{$artNoExamine}</span>
          </div>
          <div class="layui-card-body layuiadmin-card-list">
            <a lay-href="{:url('/admin/article')}" class="layadmin-backlog-body" lay-title="文章列表">
              <p class="layuiadmin-big-font">{$artTotal}</p>
            </a>
          </div>
        </div>
      </div>
      <div class="layui-col-sm6 layui-col-md3">
        <div class="layui-card">
          <div class="layui-card-header">
            用户
            <span class="layui-badge layui-bg-orange layuiadmin-badge">待审核：{$userNoExamine}</span>
          </div>
          <div class="layui-card-body layuiadmin-card-list">
            <a lay-href="{:url('/admin/user')}" class="layadmin-backlog-body" lay-title="用户列表">
              <p class="layuiadmin-big-font">{$userTotal}</p>
            </a>

          </div>
        </div>
      </div>
      <div class="layui-col-sm6 layui-col-md3">
        <div class="layui-card">
          <div class="layui-card-header">
            头像
            <span class="layui-badge layui-bg-purple layuiadmin-badge">待审核：{$avatorNoExamine}</span>
          </div>
          <div class="layui-card-body layuiadmin-card-list">
            <a lay-href="{:url('/admin/avator')}" class="layadmin-backlog-body" lay-title="头像列表">
              <p class="layuiadmin-big-font">{$avatorTotal}</p>
            </a>
          </div>
        </div>
      </div>
      <div class="layui-col-sm6 layui-col-md3">
        <div class="layui-card">
          <div class="layui-card-header">
            分类
            <span class="layui-badge layui-bg-green layuiadmin-badge">显示：{$cateShow}</span>
          </div>
          <div class="layui-card-body layuiadmin-card-list">
            <a lay-href="{:url('/admin/category')}" class="layadmin-backlog-body" lay-title="分类列表">
              <p class="layuiadmin-big-font">{$cateTotal}</p>
            </a>
          </div>
        </div>

      </div>
      <div class="layui-col-sm6 layui-col-md3">
        <div class="layui-card">
          <div class="layui-card-header">
            评论
            <span class="layui-badge layui-bg-black layuiadmin-badge">今日评论：{$commentToday}</span>
          </div>
          <div class="layui-card-body layuiadmin-card-list">
            <a lay-href="{:url('/admin/comment')}" class="layadmin-backlog-body" lay-title="分类列表">
              <p class="layuiadmin-big-font">{$commentTotal}</p>
            </a>

          </div>
        </div>

      </div>
      <div class="layui-col-sm6 layui-col-md3">
        <div class="layui-card">
          <div class="layui-card-header">
            商品
            <span class="layui-badge layui-bg-gray layuiadmin-badge">上架：{$goodUp}</span>
          </div>
          <div class="layui-card-body layuiadmin-card-list">
            <a lay-href="{:url('/admin/good')}" class="layadmin-backlog-body" lay-title="分类列表">
              <p class="layuiadmin-big-font">{$goodTotal}</p>
            </a>
          </div>
        </div>

      </div>
      <div class="layui-col-sm6 layui-col-md3">
        <div class="layui-card">
          <div class="layui-card-header">
            订单
            <span class="layui-badge layui-bg-red layuiadmin-badge">今日成交：{$order.totaySuccess} |
              盈利：{$order.todayMoney}</span>
          </div>
          <div class="layui-card-body layuiadmin-card-list">
            <a lay-href="{:url('/admin/order')}" class="layadmin-backlog-body" lay-title="订单列表">
              <p class="layuiadmin-big-font">{$order.total}</p>
            </a>
          </div>
        </div>

      </div>
      <div class="layui-col-sm6 layui-col-md3">
        <div class="layui-card">
          <div class="layui-card-header">
            卡密
            <!-- <span class="layui-badge layui-bg-black layuiadmin-badge">隐藏：{$cateShow}</span> -->
          </div>
          <div class="layui-card-body layuiadmin-card-list">
            <a lay-href="{:url('/admin/fake')}" class="layadmin-backlog-body" lay-title="卡密列表">
              <p class="layuiadmin-big-font">{$fake}</p>
            </a>
          </div>
        </div>

      </div>


      <div class="layui-col-sm12  layadmin-backlog">
        <div class="layui-card">
          <div class="layui-card-header">
            数据统计
          </div>
          <div class="layui-card-body">
            <ul class="layui-row layui-col-space10 ">
              <li class="layui-col-xs6 layadmin-backlog-body">
                <h3>软件总请求</h3>
                <p><cite>{$startUp.num}</cite></p>
                <p>今日请求:{$startUp.todayNum}</p>
              </li>
              <li class="layui-col-xs6  layadmin-backlog-body">
                <h3>日志</h3>
                <p><cite>{$log.total}</cite></p>
                <p>今日请求异常:{$log.todayError}</p>

              </li>
              <li class="layui-col-xs6  layadmin-backlog-body">
                <h3>文件</h3>
                <p><cite>{$files.total}</cite></p>
                <p>备注</p>

              </li>
              <li class="layui-col-xs6  layadmin-backlog-body">
                <h3>待添加</h3>
                <p><cite>#</cite></p>
                <p>备注</p>

              </li>
            </ul>
          </div>
        </div>
      </div>

    </div>

    <div class="layui-row layui-col-space15">
      <div class="layui-col-md4">
        <div class="layui-card">
          <div class="layui-card-header">服务器信息</div>
          <div class="layui-card-body layui-text layadmin-version">
            <table class="layui-table">
              <colgroup>
                <col width="100">
                <col>
              </colgroup>
              <tbody>
                <tr>
                  <td>程序版本</td>
                  <td>1.10</td>
                </tr>
                <tr>
                  <td>系统信息</td>
                  <td>
                    <?php echo php_uname(); ?>

                  </td>
                </tr>
                <tr>
                  <td>域名</td>
                  <td>
                    <?php echo $_SERVER['HTTP_HOST']; ?>
                  </td>
                </tr>
                <tr>
                  <td>IP地址</td>
                  <td>
                    <?php echo $_SERVER['SERVER_ADDR']; ?>
                  </td>
                </tr>
                <tr>
                  <td> PHP版本</td>
                  <td>
                    <?php echo PHP_VERSION; ?>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </div>
      </div>
      <div class="layui-col-md8">
        <div class="layui-card">
          <div class="layui-card-header">最新评论</div>
          <div class="layui-card-body">
            <div class="comment-list">
              {foreach $commentList as $k => $v}
              <div class="lis-item">
                <div class="comment-s">
                  <div class="left">
                    <a href="javascript:" onclick="editUser('{$v.userProfile.id}')"
                      class="nickname">{$v.userProfile.nickname} </a>： {$v.comment}
                  </div>
                  {if $v.article}
                  <div class="right">
                    <a href="javascript:" onclick="delComment('{$v.id}')" class="del-btn">删除</a>
                  </div>
                  {/if}

                </div>


                {if $v.article}
                <div class="art">
                  <a href="javascript:" onclick="readArt('{$v.article.id}')" class="article">--《{$v.article.title}》 </a>
                </div>
                {/if}
                <span class="tim">{$v.create_time}</span>

              </div>
              {/foreach}
            </div>
          </div>
        </div>
      </div>
    </div>

  </div>
  <script src="__LAYUIADMIN__/res/layui/layui.js"></script>
  <script>
    layui.config({
      base: '__LAYUIADMIN__/res/' // 静态资源所在路径
    }).use(['index', 'sample']);
    layui.use(() => {
      var form = layui.form;
      var layer = layui.layer;
      var laydate = layui.laydate;
      var util = layui.util;
      $ = layui.$;


    })
    function editUser(id) {
      layer.open({
        title: '编辑',
        type: 2,
        area: ['80%', '80%'],
        content: '/admin/user/edit/?id=' + id
      });
    }
    function readArt(id) {
      layer.open({
        title: '文章查看',
        type: 2,
        area: ['80%', '80%'],
        content: '/admin/article/edit/?id=' + id
      });
    }
    function delComment(id) {
      layer.confirm('真的删除这条评论吗', function (index) {
        $.get('/admin/comment/del', { id }, (res) => {
          if (res.code == 200) {
            layer.msg('删除成功')
          } else {
            layer.msg('删除失败')
          }
        })
      })

    }
  </script>
</body>

</html>